<!-- 海外wms详情查询 -->
<template>
  <el-dialog :visible.sync="visible" custom-class="dialog_big" :title="'打包记录'">
    <detail_common_new ref="detail_common_new" :tableOptions="tableOptions" :descOption="descOption" :url="url"
      :urlDataHandle="urlDataHandle">
    </detail_common_new>
  </el-dialog>
</template>

<script>

import detail_common_new from '@/component/dialog/detail_common_new'
export default {
  components: { detail_common_new },
  data() {
    return {
      visible: false,
      title: "",
      url: '/wms-api/inbound/WmsInboundTransitPackagingRpc/selectDetailById.json',
      urlDataHandle: (res) => {
        const { orderDetailList, ...data } = res.data
        return {
          descData: data, tableDatas: [orderDetailList],
        }
      },
      descOption: {
        model: [
          { key: 'packageNo', label: 'label_package_code', 'show-overflow-tooltip': true, },
          { key: 'packagingName', label: 'label_pack_material_name', 'min-width': 160, 'show-overflow-tooltip': true, formatter: (r, c, v, i) => this.$formatNameCode(v, r.packagingTypeName) },
          {
            key: 'weight', label: 'label_weight', 'width': 120, 'show-overflow-tooltip': true,
            formatter: (r, c, v) => this.$addUnit(v, 'kg'),
          },
          {
            key: 'length', label: 'label_length', 'width': 120, 'show-overflow-tooltip': true,
            formatter: (r, c, v) => this.$addUnit(v, 'cm'),
          },
          {
            key: 'width', label: 'label_width', 'width': 120, 'show-overflow-tooltip': true,
            formatter: (r, c, v) => this.$addUnit(v, 'cm'),
          },
          {
            key: 'height', label: 'label_height', 'width': 120, 'show-overflow-tooltip': true,
            formatter: (r, c, v) => this.$addUnit(v, 'cm'),
          },

          {
            key: 'destinationWarehouseName', label: 'label_destination_warehouse', 'width': 120, 'show-overflow-tooltip': true,
            formatter: (r, c, v, i) => this.$formatNameCode(v, r.destinationWarehouseCode)
          },
          {
            key: 'inboundOrderQty', label: '入库单数量', 'width': 100, 'show-overflow-tooltip': true,
          },
          {
            key: 'boxQty', label: '装箱数量', 'width': 100, 'show-overflow-tooltip': true,
          },
          {
            key: 'measureStatus', label: '测量状态', 'width': 120, 'show-overflow-tooltip': true, formatter: (r, c, v) => this.$enumShow(v, 'MeasureStatusEnum')
          },
        ],
      },
      tableOptions: [
        {
          attrs:{
            height:300,
          },
          model: [
            {
              key: "boxNo", label: "label_box_code", 'show-overflow-tooltip': true,

            },
            {
              key: 'inboundOrderCode', label: 'label_inbound_code', 'show-overflow-tooltip': true,

            },

          ],
        },
      ],
    }
  },
  methods: {

    show({ title, ...obj }) {
      this.title = title
      this.visible = true
      this.$nextTick(() => {
        this.$refs['detail_common_new'].show(obj)
      })
    },
    hide() {
      this.visible = false
    },

  }
}
</script>
